/*
 * c7_review10.cpp
 *
 *  Created on: Sep 1, 2013
 *      Author: cyper.yin
 */

#include <iostream>
using namespace std;

struct point{
	int x;
	int y;
};
void set_point(point *);
void show_point(point);

int main_c7r10(int argc, char **argv) {
	point glitz;

	//pass by address, you can change it.
	set_point(&glitz);

	//pass by value, you can only read it.
	show_point(glitz);

	return 0;
}

void set_point(point * p){
	p->x = 1;
	p->y = 2;
}

void show_point(point p){
	cout << "x =" << p.x << endl;
	cout << "y =" << p.y << endl;
}

